<template>
  <el-container>
    <!-- 头部 -->
    <el-header>
      <home-header></home-header>
    </el-header>
    <!-- 主体内容区 -->
    <el-container>
      <!-- 左侧边栏 -->
      <el-aside :width="MenuWidth">
        <home-aside @setMenuWidth="setMenuWidth"></home-aside>
      </el-aside>
      <!-- 右侧内容主体 -->
      <el-main>
        <breadcrumb></breadcrumb>
        <router-view :key="$route.fullPath"></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
import HomeHeader from './HomeHeader'
import HomeAside from './HomeAside'
import Breadcrumb from './Breadcrumb'
export default {
  components: {
    HomeHeader,
    HomeAside,
    Breadcrumb
  },
  data() {
    return {
      isCollapse: false
    }
  },
  methods: {
    setMenuWidth(isCollapse) {
      this.isCollapse = isCollapse
    }
  },
  computed: {
    MenuWidth() {
      return this.isCollapse ? '64px' : '200px'
    }
  }
}
</script>
<style lang="less" scoped>
.el-container {
  height: 100%;

  .el-header {
    background-color: #373d41;
  }

  .el-aside {
    background-color: #333744;
  }
  .el-main {
    background-color: #eaedf1;
  }
}
</style>